Page({

  /**
   * 页面的初始数据
   */
  data: {
    id:0,
    items:{order_items:[]}
  },

  onLoad(options) {
    this.setData({
      id:options.id
    })
    this.load();
  },
  onShow(){
    this.load();
  },
  toDetail(e){
    let left=e.currentTarget.dataset.left;
    left=parseInt(left);
    if(left<=0){
      wx.util.toast("该服务已用完");
      return;
    }
    wx.navigateTo({
      url: '/pages/card/order_add?id='+e.currentTarget.dataset.id,
    })
  },
  async load(){
    let res=await wx.util.post("card_order/detail",{id:this.data.id});
    this.setData({
      items: res.data
    })
  },

})